/*
 *https://leetcode.cn/problems/running-sum-of-1d-array/
 *1480. 一维数组的动态和
 *medium 吴朝泽 2024.11.30
 *前缀和
*/

#include<bits/stdc++.h>
using namespace std;
class Solution {
public:
    vector<int> runningSum(vector<int>& nums) {
        int len = nums.size();
        vector<int> arr(len);

        arr[0] = nums[0];
        for(int i = 1; i < len; ++i)
        {
            arr[i] = arr[i-1] + nums[i];
        }
        return arr;
    }
};